#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>
#include <QWidget>
#include <QSlider>
#include <QTabWidget>
#include <QMenu>
#include <QAction>
#include <QDialog>

class QSlider;

class GLWidget;
class viewerWidget;
class animatorWidget;
class rawdataWidget;
class Core;
class Robot;

class MainWindow : public QMainWindow
{
	Q_OBJECT

public:
	MainWindow(QApplication *app, QStringList *arguments);
	~MainWindow();

public slots:
	void robotLoaded();
	
signals:

private slots:
	bool open();
	bool save();
	void about();
	void showAllJointData();
	void exportRobotData();
	
	void showNoAxes();
	void showAllAxes();
	void drawAxesJoint0(bool checked);
	void drawAxesJoint1(bool checked);
	void drawAxesJoint2(bool checked);
	void drawAxesJoint3(bool checked);
	void drawAxesJoint4(bool checked);
	void drawAxesJoint5(bool checked);
	void drawAxesJoint6(bool checked);
	
private:
	QApplication *parent;
	QString programName;
	
	Robot *robot;
	Core *core;
	
	void initialize();
	
	void createActions();
	void createMenus();
	void createToolBars();
	void createStatusBar();
	
	//the widgets that makeup the various tabs
	viewerWidget *viewer;
	animatorWidget *animator;
	rawdataWidget *rawdata;
	QTabWidget	*tabs;
	
	//widget indicies for accessing the tabwidget
	int viewerIndex;
	int rawdataIndex;
	int animatorIndex;
	
	//Actions
	QAction *openAction;
	QAction *saveAction;
	QAction *exitAction;
	QAction *aboutAction;
	QAction *showAllJointDataAction;
	QAction *exportRobotDataAction;
	QAction *resetViewAction;
	
	QMenu *fileMenu;
	QMenu *robotMenu;
	QMenu *helpMenu;
	
	QMenu *drawAxesMenu;
	QAction *drawNoAxesAction;
	QAction *drawAllAxesAction;
	QAction *drawAxesJoint0Act;
	QAction *drawAxesJoint1Act;
	QAction *drawAxesJoint2Act;
	QAction *drawAxesJoint3Act;
	QAction *drawAxesJoint4Act;
	QAction *drawAxesJoint5Act;
	QAction *drawAxesJoint6Act;
	
	
};

#endif
